package com.zdp.controller.center;

import com.zdp.common.domain.ResultInfo;
import com.zdp.common.util.ResultInfoUtil;
import com.zdp.pojo.Users;
import com.zdp.service.center.CenterUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sesshomaru
 * @date 2021/8/14 17:45
 * 用户中心
 */
@RestController
@RequestMapping("center")
public class CenterController{

    @Autowired
    private CenterUserService centerUserService;

    //获取用户信息
    @GetMapping("userInfo")
    public ResultInfo userInfo(
            @RequestParam String userId) {

        Users user = centerUserService.queryUserInfo(userId);
        return ResultInfoUtil.buildSuccess(user);
    }
}
